.class public final Lcom/greystripe/sdk/GSFullscreenActivity;
.super Landroid/app/Activity;

# interfaces
.implements Landroid/hardware/Camera$PictureCallback;


# instance fields
.field private a:Lcom/greystripe/sdk/ay;

.field private b:Landroid/widget/FrameLayout;

.field private c:Lcom/greystripe/sdk/GSFullscreenAd;

.field private d:Lcom/greystripe/sdk/at;

.field private e:I

.field private f:Landroid/hardware/Camera;

.field private g:Landroid/hardware/Camera$Parameters;

.field private h:Lcom/greystripe/sdk/CameraPreview;

.field private i:Z

.field private j:Ljava/util/Timer;


# direct methods
.method public constructor <init>()V
    .locals 1

    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    const/4 v0, -0x1

    iput v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->e:I

    return-void
.end method

.method static synthetic a(Lcom/greystripe/sdk/GSFullscreenActivity;)Lcom/greystripe/sdk/CameraPreview;
    .locals 1

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->h:Lcom/greystripe/sdk/CameraPreview;

    return-object v0
.end method

.method static synthetic b(Lcom/greystripe/sdk/GSFullscreenActivity;)Lcom/greystripe/sdk/ay;
    .locals 1

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->a:Lcom/greystripe/sdk/ay;

    return-object v0
.end method

.method private b(I)V
    .locals 4

    const/4 v3, 0x0

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->f:Landroid/hardware/Camera;

    if-nez v0, :cond_0

    const-string v0, "camera was null"

    new-array v1, v3, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    :goto_0
    return-void

    :cond_0
    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->f:Landroid/hardware/Camera;

    invoke-virtual {v0}, Landroid/hardware/Camera;->getParameters()Landroid/hardware/Camera$Parameters;

    move-result-object v0

    iput-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->g:Landroid/hardware/Camera$Parameters;

    sget-object v0, Landroid/os/Build$VERSION;->SDK:Ljava/lang/String;

    invoke-static {v0}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v0

    const/16 v1, 0x8

    if-lt v0, v1, :cond_2

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->f:Landroid/hardware/Camera;

    const/16 v1, 0x5a

    invoke-virtual {v0, v1}, Landroid/hardware/Camera;->setDisplayOrientation(I)V

    :cond_1
    :goto_1
    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->f:Landroid/hardware/Camera;

    iget-object v1, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->g:Landroid/hardware/Camera$Parameters;

    invoke-virtual {v0, v1}, Landroid/hardware/Camera;->setParameters(Landroid/hardware/Camera$Parameters;)V

    goto :goto_0

    :cond_2
    const/4 v0, 0x1

    if-ne p1, v0, :cond_3

    const-string v0, "cam rotating to portrait"

    new-array v1, v3, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->g:Landroid/hardware/Camera$Parameters;

    const-string v1, "orientation"

    const-string v2, "portrait"

    invoke-virtual {v0, v1, v2}, Landroid/hardware/Camera$Parameters;->set(Ljava/lang/String;Ljava/lang/String;)V

    :cond_3
    const/4 v0, 0x2

    if-ne p1, v0, :cond_1

    const-string v0, "cam rotating to landscape"

    new-array v1, v3, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->g:Landroid/hardware/Camera$Parameters;

    const-string v1, "orientation"

    const-string v2, "landscape"

    invoke-virtual {v0, v1, v2}, Landroid/hardware/Camera$Parameters;->set(Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_1
.end method

.method static synthetic c(Lcom/greystripe/sdk/GSFullscreenActivity;)Lcom/greystripe/sdk/GSFullscreenAd;
    .locals 1

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    return-object v0
.end method

.method private c()V
    .locals 3

    sget v0, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v1, 0xb

    if-lt v0, v1, :cond_0

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v0}, Lcom/greystripe/sdk/GSFullscreenAd;->j()Lcom/greystripe/sdk/aa;

    move-result-object v0

    const/4 v1, 0x0

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Lcom/greystripe/sdk/aa;->setLayerType(ILandroid/graphics/Paint;)V

    :cond_0
    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->b:Landroid/widget/FrameLayout;

    iget-object v1, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->a:Lcom/greystripe/sdk/ay;

    invoke-virtual {v0, v1}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->d:Lcom/greystripe/sdk/at;

    iget-object v1, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->b:Landroid/widget/FrameLayout;

    invoke-virtual {v0, v1}, Lcom/greystripe/sdk/at;->setRootLayout(Landroid/widget/FrameLayout;)V

    return-void
.end method

.method private d()Landroid/hardware/Camera;
    .locals 9

    const/4 v8, 0x1

    const/4 v3, 0x0

    const/4 v0, 0x0

    sget-object v1, Landroid/os/Build$VERSION;->SDK:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I

    move-result v1

    const/16 v2, 0x9

    if-lt v1, v2, :cond_3

    new-instance v4, Landroid/hardware/Camera$CameraInfo;

    invoke-direct {v4}, Landroid/hardware/Camera$CameraInfo;-><init>()V

    invoke-static {}, Landroid/hardware/Camera;->getNumberOfCameras()I

    move-result v5

    move v2, v3

    :goto_0
    if-ge v2, v5, :cond_1

    invoke-static {v2, v4}, Landroid/hardware/Camera;->getCameraInfo(ILandroid/hardware/Camera$CameraInfo;)V

    iget v1, v4, Landroid/hardware/Camera$CameraInfo;->facing:I

    if-ne v1, v8, :cond_0

    :try_start_0
    invoke-static {v2}, Landroid/hardware/Camera;->open(I)Landroid/hardware/Camera;

    move-result-object v0

    const/4 v1, 0x1

    iput-boolean v1, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->i:Z
    :try_end_0
    .catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0

    :cond_0
    :goto_1
    add-int/lit8 v1, v2, 0x1

    move v2, v1

    goto :goto_0

    :catch_0
    move-exception v1

    const-string v6, "Front camera failed to open"

    new-array v7, v3, [Ljava/lang/Object;

    invoke-static {v6, v7}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    invoke-virtual {v1}, Ljava/lang/RuntimeException;->printStackTrace()V

    goto :goto_1

    :cond_1
    if-nez v0, :cond_2

    invoke-direct {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->e()Landroid/hardware/Camera;

    move-result-object v0

    :cond_2
    :goto_2
    return-object v0

    :cond_3
    invoke-direct {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->e()Landroid/hardware/Camera;

    move-result-object v0

    goto :goto_2
.end method

.method private e()Landroid/hardware/Camera;
    .locals 4

    const/4 v3, 0x0

    iput-boolean v3, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->i:Z

    const/4 v0, 0x0

    :try_start_0
    invoke-static {}, Landroid/hardware/Camera;->open()Landroid/hardware/Camera;
    :try_end_0
    .catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :goto_0
    return-object v0

    :catch_0
    move-exception v1

    const-string v2, "Back camera failed to open"

    new-array v3, v3, [Ljava/lang/Object;

    invoke-static {v2, v3}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    invoke-virtual {v1}, Ljava/lang/RuntimeException;->printStackTrace()V

    goto :goto_0
.end method

.method private f()Landroid/hardware/Camera;
    .locals 4

    const/4 v0, 0x0

    :try_start_0
    invoke-direct {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->d()Landroid/hardware/Camera;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    :goto_0
    return-object v0

    :catch_0
    move-exception v1

    const-string v2, "Camera does not exist."

    const/4 v3, 0x0

    new-array v3, v3, [Ljava/lang/Object;

    invoke-static {v2, v3}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    invoke-virtual {v1}, Ljava/lang/Exception;->printStackTrace()V

    goto :goto_0
.end method

.method private g()V
    .locals 4

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    if-nez v0, :cond_1

    :cond_0
    :goto_0
    return-void

    :cond_1
    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v0}, Lcom/greystripe/sdk/GSFullscreenAd;->m()I

    move-result v0

    iget v1, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->e:I

    if-eq v0, v1, :cond_0

    const-string v1, "cam orientation changed!"

    const/4 v2, 0x0

    new-array v2, v2, [Ljava/lang/Object;

    invoke-static {v1, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iget-object v1, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v1}, Lcom/greystripe/sdk/GSFullscreenAd;->j()Lcom/greystripe/sdk/aa;

    move-result-object v1

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "EventHandler.broadcastEvent(\'orientationchange\', "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v3, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v3}, Lcom/greystripe/sdk/GSFullscreenAd;->m()I

    move-result v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, ");"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v1, v2}, Lcom/greystripe/sdk/aa;->b(Ljava/lang/String;)V

    iput v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->e:I

    goto :goto_0
.end method


# virtual methods
.method final a()I
    .locals 1

    invoke-virtual {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;

    move-result-object v0

    iget v0, v0, Landroid/content/res/Configuration;->orientation:I

    return v0
.end method

.method final a(I)V
    .locals 2

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v1, "fullscreenactivity#setOrientation("

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v1, ")"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    invoke-virtual {p0, p1}, Lcom/greystripe/sdk/GSFullscreenActivity;->setRequestedOrientation(I)V

    invoke-direct {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->g()V

    return-void
.end method

.method protected final b()V
    .locals 4

    const/4 v3, 0x0

    const/4 v2, 0x1

    const-string v0, "FullscreenActivity#lockOrientation()"

    new-array v1, v3, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    invoke-virtual {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->a()I

    move-result v0

    packed-switch v0, :pswitch_data_0

    :goto_0
    return-void

    :pswitch_0
    invoke-virtual {p0, v3}, Lcom/greystripe/sdk/GSFullscreenActivity;->a(I)V

    goto :goto_0

    :pswitch_1
    invoke-virtual {p0, v2}, Lcom/greystripe/sdk/GSFullscreenActivity;->a(I)V

    goto :goto_0

    :pswitch_2
    invoke-virtual {p0, v2}, Lcom/greystripe/sdk/GSFullscreenActivity;->a(I)V

    goto :goto_0

    :pswitch_3
    invoke-virtual {p0, v2}, Lcom/greystripe/sdk/GSFullscreenActivity;->a(I)V

    goto :goto_0

    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_3
        :pswitch_1
        :pswitch_0
        :pswitch_2
    .end packed-switch
.end method

.method public final onBackPressed()V
    .locals 2

    const-string v0, "onBackPressed"

    const/4 v1, 0x0

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->j:Ljava/util/Timer;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->j:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->cancel()V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->j:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->purge()I

    :cond_0
    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->d:Lcom/greystripe/sdk/at;

    invoke-virtual {v0}, Lcom/greystripe/sdk/at;->a()V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v0}, Lcom/greystripe/sdk/GSFullscreenAd;->k()V

    return-void
.end method

.method public final onConfigurationChanged(Landroid/content/res/Configuration;)V
    .locals 0

    invoke-super {p0, p1}, Landroid/app/Activity;->onConfigurationChanged(Landroid/content/res/Configuration;)V

    invoke-direct {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->g()V

    return-void
.end method

.method protected final onCreate(Landroid/os/Bundle;)V
    .locals 15

    const v0, 0x1030011

    invoke-virtual {p0, v0}, Lcom/greystripe/sdk/GSFullscreenActivity;->setTheme(I)V

    invoke-super/range {p0 .. p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    sget-object v0, Lcom/greystripe/sdk/GSFullscreenAd;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    if-nez v0, :cond_0

    invoke-virtual {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->finish()V

    :goto_0
    return-void

    :cond_0
    sget-object v0, Lcom/greystripe/sdk/GSFullscreenAd;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    iput-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    iget-object v0, v0, Lcom/greystripe/sdk/GSFullscreenAd;->d:Lcom/greystripe/sdk/at;

    iput-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->d:Lcom/greystripe/sdk/at;

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v0, p0}, Lcom/greystripe/sdk/GSFullscreenAd;->a(Lcom/greystripe/sdk/GSFullscreenActivity;)V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->d:Lcom/greystripe/sdk/at;

    invoke-virtual {v0, p0}, Lcom/greystripe/sdk/at;->setActivity(Landroid/app/Activity;)V

    new-instance v0, Lcom/greystripe/sdk/ay;

    iget-object v1, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-direct {v0, p0, v1}, Lcom/greystripe/sdk/ay;-><init>(Landroid/content/Context;Lcom/greystripe/sdk/GSFullscreenAd;)V

    iput-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->a:Lcom/greystripe/sdk/ay;

    new-instance v0, Landroid/widget/FrameLayout;

    invoke-direct {v0, p0}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->b:Landroid/widget/FrameLayout;

    invoke-direct {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->g()V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    iget-boolean v0, v0, Lcom/greystripe/sdk/GSFullscreenAd;->b:Z

    if-eqz v0, :cond_7

    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->i:Z

    invoke-direct {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->f()Landroid/hardware/Camera;

    move-result-object v0

    iput-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->f:Landroid/hardware/Camera;

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->f:Landroid/hardware/Camera;

    if-eqz v0, :cond_6

    iget-boolean v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->i:Z

    if-eqz v0, :cond_2

    const/4 v0, -0x1

    invoke-direct {p0, v0}, Lcom/greystripe/sdk/GSFullscreenActivity;->b(I)V

    :goto_1
    new-instance v0, Lcom/greystripe/sdk/CameraPreview;

    iget-object v1, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->f:Landroid/hardware/Camera;

    invoke-direct {v0, p0, v1}, Lcom/greystripe/sdk/CameraPreview;-><init>(Landroid/content/Context;Landroid/hardware/Camera;)V

    iput-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->h:Lcom/greystripe/sdk/CameraPreview;

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->f:Landroid/hardware/Camera;

    invoke-virtual {v0}, Landroid/hardware/Camera;->getParameters()Landroid/hardware/Camera$Parameters;

    move-result-object v0

    iput-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->g:Landroid/hardware/Camera$Parameters;

    new-instance v8, Landroid/widget/RelativeLayout;

    invoke-direct {v8, p0}, Landroid/widget/RelativeLayout;-><init>(Landroid/content/Context;)V

    invoke-virtual {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v1

    iget v0, v1, Landroid/util/DisplayMetrics;->widthPixels:I

    iget v1, v1, Landroid/util/DisplayMetrics;->heightPixels:I

    if-ge v0, v1, :cond_1

    move v1, v0

    :cond_1
    invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Runtime;->maxMemory()J

    move-result-wide v2

    long-to-double v2, v2

    const-wide v4, 0x3fb999999999999aL

    mul-double/2addr v2, v4

    double-to-long v9, v2

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->g:Landroid/hardware/Camera$Parameters;

    invoke-virtual {v0}, Landroid/hardware/Camera$Parameters;->getSupportedPictureSizes()Ljava/util/List;

    move-result-object v11

    const/4 v4, 0x0

    const/4 v3, 0x0

    const/4 v2, 0x0

    const/4 v0, 0x0

    move v5, v0

    :goto_2
    invoke-interface {v11}, Ljava/util/List;->size()I

    move-result v0

    if-ge v5, v0, :cond_3

    invoke-interface {v11, v5}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/hardware/Camera$Size;

    iget v6, v0, Landroid/hardware/Camera$Size;->width:I

    iget v7, v0, Landroid/hardware/Camera$Size;->height:I

    if-ge v6, v7, :cond_b

    :goto_3
    mul-int v12, v7, v6

    int-to-long v12, v12

    cmp-long v12, v12, v9

    if-gtz v12, :cond_a

    if-le v7, v4, :cond_a

    if-le v6, v3, :cond_a

    iget v3, v0, Landroid/hardware/Camera$Size;->width:I

    iget v2, v0, Landroid/hardware/Camera$Size;->height:I

    :goto_4
    add-int/lit8 v4, v5, 0x1

    move v5, v4

    move v4, v3

    move v3, v2

    move-object v2, v0

    goto :goto_2

    :cond_2
    const/4 v0, 0x1

    invoke-direct {p0, v0}, Lcom/greystripe/sdk/GSFullscreenActivity;->b(I)V

    goto :goto_1

    :cond_3
    if-nez v2, :cond_4

    const/4 v0, 0x0

    invoke-interface {v11, v0}, Ljava/util/List;->get(I)Ljava/lang/Object;

    :cond_4
    new-instance v0, Ljava/lang/StringBuilder;

    const-string v2, "picture size: w:"

    invoke-direct {v0, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    const-string v2, ", h: "

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const/4 v2, 0x0

    new-array v2, v2, [Ljava/lang/Object;

    invoke-static {v0, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->g:Landroid/hardware/Camera$Parameters;

    invoke-virtual {v0, v4, v3}, Landroid/hardware/Camera$Parameters;->setPictureSize(II)V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->f:Landroid/hardware/Camera;

    iget-object v2, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->g:Landroid/hardware/Camera$Parameters;

    invoke-virtual {v0, v2}, Landroid/hardware/Camera;->setParameters(Landroid/hardware/Camera$Parameters;)V

    if-le v3, v1, :cond_9

    int-to-float v0, v4

    int-to-float v2, v3

    div-float/2addr v0, v2

    int-to-float v2, v1

    mul-float/2addr v0, v2

    float-to-int v4, v0

    :goto_5
    const/4 v0, 0x1

    int-to-float v2, v4

    invoke-virtual {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v3

    invoke-static {v0, v2, v3}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F

    move-result v0

    float-to-int v0, v0

    const/4 v2, 0x1

    int-to-float v1, v1

    invoke-virtual {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->getResources()Landroid/content/res/Resources;

    move-result-object v3

    invoke-virtual {v3}, Landroid/content/res/Resources;->getDisplayMetrics()Landroid/util/DisplayMetrics;

    move-result-object v3

    invoke-static {v2, v1, v3}, Landroid/util/TypedValue;->applyDimension(IFLandroid/util/DisplayMetrics;)F

    move-result v1

    float-to-int v1, v1

    if-le v0, v1, :cond_8

    :goto_6
    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "dipw: "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, ", diph: "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    const/4 v3, 0x0

    new-array v3, v3, [Ljava/lang/Object;

    invoke-static {v2, v3}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    sget v2, Landroid/os/Build$VERSION;->SDK_INT:I

    const/16 v3, 0xb

    if-lt v2, v3, :cond_5

    iget-object v2, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v2}, Lcom/greystripe/sdk/GSFullscreenAd;->j()Lcom/greystripe/sdk/aa;

    move-result-object v2

    const/4 v3, 0x1

    const/4 v4, 0x0

    invoke-virtual {v2, v3, v4}, Lcom/greystripe/sdk/aa;->setLayerType(ILandroid/graphics/Paint;)V

    :cond_5
    new-instance v2, Landroid/widget/RelativeLayout$LayoutParams;

    invoke-direct {v2, v1, v0}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V

    const/16 v0, 0xd

    invoke-virtual {v2, v0}, Landroid/widget/RelativeLayout$LayoutParams;->addRule(I)V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->h:Lcom/greystripe/sdk/CameraPreview;

    invoke-virtual {v8, v0, v2}, Landroid/widget/RelativeLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    new-instance v0, Landroid/widget/RelativeLayout$LayoutParams;

    const/4 v1, -0x1

    const/4 v2, -0x1

    invoke-direct {v0, v1, v2}, Landroid/widget/RelativeLayout$LayoutParams;-><init>(II)V

    iget-object v1, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->a:Lcom/greystripe/sdk/ay;

    invoke-virtual {v8, v1, v0}, Landroid/widget/RelativeLayout;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->b:Landroid/widget/FrameLayout;

    invoke-virtual {v0, v8}, Landroid/widget/FrameLayout;->addView(Landroid/view/View;)V

    new-instance v0, Ljava/util/Timer;

    invoke-direct {v0}, Ljava/util/Timer;-><init>()V

    iput-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->j:Ljava/util/Timer;

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->j:Ljava/util/Timer;

    new-instance v1, Lcom/greystripe/sdk/az;

    invoke-direct {v1, p0}, Lcom/greystripe/sdk/az;-><init>(Lcom/greystripe/sdk/GSFullscreenActivity;)V

    const-wide/16 v2, 0x1f4

    const-wide/16 v4, 0x7d0

    invoke-virtual/range {v0 .. v5}, Ljava/util/Timer;->scheduleAtFixedRate(Ljava/util/TimerTask;JJ)V

    :goto_7
    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->b:Landroid/widget/FrameLayout;

    invoke-virtual {p0, v0}, Lcom/greystripe/sdk/GSFullscreenActivity;->setContentView(Landroid/view/View;)V

    goto/16 :goto_0

    :cond_6
    invoke-direct {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->c()V

    goto :goto_7

    :cond_7
    invoke-direct {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->c()V

    goto :goto_7

    :cond_8
    move v14, v1

    move v1, v0

    move v0, v14

    goto :goto_6

    :cond_9
    move v1, v3

    goto/16 :goto_5

    :cond_a
    move-object v0, v2

    move v2, v3

    move v3, v4

    goto/16 :goto_4

    :cond_b
    move v14, v7

    move v7, v6

    move v6, v14

    goto/16 :goto_3
.end method

.method public final onPictureTaken([BLandroid/hardware/Camera;)V
    .locals 7

    const/4 v1, 0x0

    :try_start_0
    invoke-virtual {p2}, Landroid/hardware/Camera;->startPreview()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    :goto_0
    const-string v0, "activity"

    invoke-virtual {p0, v0}, Lcom/greystripe/sdk/GSFullscreenActivity;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Landroid/app/ActivityManager;

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "pic memory: "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Landroid/app/ActivityManager;->getMemoryClass()I

    move-result v0

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    new-array v2, v1, [Ljava/lang/Object;

    invoke-static {v0, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v2, "pic runtime memory: "

    invoke-direct {v0, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Runtime;->maxMemory()J

    move-result-wide v2

    invoke-virtual {v0, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    new-array v2, v1, [Ljava/lang/Object;

    invoke-static {v0, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    new-instance v0, Ljava/lang/StringBuilder;

    const-string v2, "pic byte memory: "

    invoke-direct {v0, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    array-length v2, p1

    invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    new-array v2, v1, [Ljava/lang/Object;

    invoke-static {v0, v2}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    array-length v0, p1

    invoke-static {p1, v1, v0}, Landroid/graphics/BitmapFactory;->decodeByteArray([BII)Landroid/graphics/Bitmap;

    move-result-object v0

    const-string v2, "allocated decodedPicture"

    new-array v3, v1, [Ljava/lang/Object;

    invoke-static {v2, v3}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    new-instance v5, Landroid/graphics/Matrix;

    invoke-direct {v5}, Landroid/graphics/Matrix;-><init>()V

    iget-boolean v2, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->i:Z

    if-eqz v2, :cond_1

    const/high16 v2, -0x4080

    const/high16 v3, 0x3f80

    invoke-virtual {v5, v2, v3}, Landroid/graphics/Matrix;->preScale(FF)Z

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v2

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v3

    if-le v2, v3, :cond_0

    const-string v2, "rotating 270 degrees"

    new-array v3, v1, [Ljava/lang/Object;

    invoke-static {v2, v3}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    const/high16 v2, 0x4387

    invoke-virtual {v5, v2}, Landroid/graphics/Matrix;->preRotate(F)Z

    :cond_0
    :goto_1
    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v3

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v4

    move v2, v1

    move v6, v1

    invoke-static/range {v0 .. v6}, Landroid/graphics/Bitmap;->createBitmap(Landroid/graphics/Bitmap;IIIILandroid/graphics/Matrix;Z)Landroid/graphics/Bitmap;

    move-result-object v0

    const-string v2, "allocated picture"

    new-array v3, v1, [Ljava/lang/Object;

    invoke-static {v2, v3}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    new-instance v2, Ljava/lang/StringBuilder;

    const-string v3, "decoded picture w "

    invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    const-string v3, " h "

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v0}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v3

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    new-array v1, v1, [Ljava/lang/Object;

    invoke-static {v2, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    new-instance v1, Lcom/greystripe/sdk/ba;

    invoke-direct {v1, p0, v0}, Lcom/greystripe/sdk/ba;-><init>(Lcom/greystripe/sdk/GSFullscreenActivity;Landroid/graphics/Bitmap;)V

    invoke-static {v1}, Lcom/greystripe/sdk/bm;->a(Ljava/lang/Runnable;)Z

    return-void

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    invoke-virtual {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->onBackPressed()V

    goto/16 :goto_0

    :cond_1
    const/high16 v2, 0x42b4

    invoke-virtual {v5, v2}, Landroid/graphics/Matrix;->preRotate(F)Z

    goto :goto_1
.end method

.method protected final onStop()V
    .locals 3

    const/4 v2, 0x0

    invoke-super {p0}, Landroid/app/Activity;->onStop()V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v0}, Lcom/greystripe/sdk/GSFullscreenAd;->l()Z

    move-result v0

    if-nez v0, :cond_0

    const-string v0, "ad didn\'t have interaction"

    new-array v1, v2, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v0}, Lcom/greystripe/sdk/GSFullscreenAd;->k()V

    :cond_0
    const-string v0, "closeActivity()"

    new-array v1, v2, [Ljava/lang/Object;

    invoke-static {v0, v1}, Lcom/greystripe/sdk/bd;->b(Ljava/lang/String;[Ljava/lang/Object;)V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->j:Ljava/util/Timer;

    if-eqz v0, :cond_1

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->j:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->cancel()V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->j:Ljava/util/Timer;

    invoke-virtual {v0}, Ljava/util/Timer;->purge()I

    :cond_1
    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->a:Lcom/greystripe/sdk/ay;

    invoke-virtual {v0}, Lcom/greystripe/sdk/ay;->a()V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->d:Lcom/greystripe/sdk/at;

    invoke-virtual {v0}, Lcom/greystripe/sdk/at;->clearReferences()V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v0}, Lcom/greystripe/sdk/GSFullscreenAd;->n()V

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {v0}, Lcom/greystripe/sdk/GSFullscreenAd;->d()V

    const/4 v0, 0x0

    sput-object v0, Lcom/greystripe/sdk/GSFullscreenAd;->c:Lcom/greystripe/sdk/GSFullscreenAd;

    invoke-virtual {p0}, Lcom/greystripe/sdk/GSFullscreenActivity;->finish()V

    return-void
.end method

.method public final takeScreenshot()V
    .locals 2

    const/4 v1, 0x0

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->f:Landroid/hardware/Camera;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/greystripe/sdk/GSFullscreenActivity;->f:Landroid/hardware/Camera;

    invoke-virtual {v0, v1, v1, p0}, Landroid/hardware/Camera;->takePicture(Landroid/hardware/Camera$ShutterCallback;Landroid/hardware/Camera$PictureCallback;Landroid/hardware/Camera$PictureCallback;)V

    :cond_0
    return-void
.end method
